{% extends 'PHPDishWebBundle:Common:notification_layout.html.twig' %}

{% block notification_content %}
    <div class="panel panel-u">
        <div class="panel-heading">{{ thread.subject }}</div>
        <ul class="list-group chat-list">
            {% for message in thread.messages %}
                <li class="list-group-item">
                    <div class="media chat">
                        <div class="media-left">
                            <a href="{{ path('user_view', {username: message.sender.username}) }}">
                                <img class="media-object avatar" src="{{ asset(message.sender.avatar)|imagine_filter('middle_square') }}">
                            </a>
                        </div>
                        <div class="media-body" id="message_{{ message.id }}">
                            <div class="media-heading">
                                {{ message.sender }}
                                <span class="meta pull-right">{{ message.createdAt|time_diff }}</span>
                            </div>
                            {{ message.body|raw }}
                        </div>
                    </div>
                </li>
            {% endfor %}
        </ul>
        <div class="panel-body reply-chat">
            {{ form_start(form, {'action': url('fos_message_thread_view', {'threadId': thread.id}) , 'attr': {'id': 'reply-chat-form'}}) }}
                <div class="form-group">
                    {{ form_widget(form.body, {'attr': {'class': 'form-control body', 'placeholder': '回复内容'}}) }}
                    {{ form_errors(form.body) }}
                </div>
                <div class="form-group">
                    <button type="submit" class="btn u-btn-primary submit-btn"><i class="if i-publish"></i> 回复</button>
                </div>
            {{ form_end(form) }}
        </div>
    </div>
{% endblock %}
